---
run:
  # Tell golangci-lint to not acquire a lock because
  # arcanist will run multiple instances in parallel.
  allow-parallel-runners: true
  # arcanist runs many of these in parallel causing
  # CPU contention and longer runtimes.
  timeout: 3m

output:
  sort-results: true

issues:
  max-issues-per-linter: 0
  max-same-issues: 0

linters:
  enable:
  - asciicheck
  - errcheck
  # Although goimports includes gofmt, it doesn't support the simplify option.
  # So we include gofmt here.
  - gofmt
  - gosimple
  - govet
  - ineffassign
  - makezero
  - misspell
  - nakedret
  - nolintlint
  - nonamedreturns
  - predeclared
  - revive
  - staticcheck
  # https://github.com/golangci/golangci-lint/issues/2649
  # - structcheck
  - typecheck
  - unused
  # https://github.com/golangci/golangci-lint/issues/2649
  # - wastedassign
  - whitespace
  disable:
  # The following linters are run separately by arcanist at the moment.
  # This is because we have autofix hooks for these linters.
  - goimports
  disable-all: false

linters-settings:
  errcheck:
    # yamllint disable-line rule:line-length
    ignore: io:Close,github.com/fatih/color,github.com/spf13/pflag:MarkHidden,github.com/spf13/viper:(BindEnv|BindPFlag),github.com/spf13/cobra:(Help|MarkFlagRequired|Usage),github.com/segmentio/analytics-go/v3:Enqueue,database/sql:Rollback,github.com/nats-io/nats.go:Unsubscribe
  goimports:
    local-prefixes: px.dev
  nakedret:
    max-func-lines: 0
